#ifndef STARTBUTTON_H
#define STARTBUTTON_H

#include "Sprite.h"
#include "FlashingAnimation.h"
#include "FlashingAnimator.h"
#include "Timer.h"
#include "AnimatorHolder.h"

class StartButton : public Sprite {
	FlashingAnimation *anim;
	FlashingAnimator *animator;
public:
	StartButton(Dim _x, Dim _y, AnimationFilm *film, FlashingAnimation *_anim, FlashingAnimator *_animator): 
	  Sprite(_x, _y, film), anim(_anim), animator(_animator) {};
	virtual void ResetToDefaultFilm(void) {}; //no need to implement in current game
	void StartFlashing(void) {
		anim->SetRepetitions(0);
		animator->Start(this, anim, Timer::getgametime());
		AnimatorHolder::MarkAsRunning(animator);
	};
	void StopFlashing(void) {
		AnimatorHolder::MarkAsSuspended(animator);
		AnimatorHolder::Cancel(animator);
	};
};

#endif